<?php

namespace app\queue\stomp;

use app\queue\BaseConsumer;
use common\service\FixDataService;
use common\service\ReviewTaskService;

class FixMonthWorkTimeRecordConsumer extends BaseConsumer
{

    // 要消费的队列名
    public $queue = 'fix_month_work_time_record';

    // 连接名，对应 config/redis_queue.php 里的连接`
    public $connection = 'default';

    /**
     * 任务排期
     * @param $data
     * @throws \Throwable
     */
    public function doConsume($data)
    {
        $userList = $data["user_id"];
        $tenantId = $data["tenant_id"];
        $startTime = $data["start_time"];
        $endTime = $data["end_time"];
        try {
            FixDataService::getInstance()->fixMonthWorkTimeRecord($userList, $tenantId, $startTime, $endTime);
        } catch (\Throwable $e) {
            trace(format_exception_info($e), 'ERR');
        }
    }
}
